package com.yunhe.marketing.repository;

import com.yunhe.marketing.domain.FilterCondition;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.logging.Filter;

/**
 * @Author: DongWenYu
 * @Date: 2021/2/22 17:25
 */
@Repository
public interface FilterConditionRepository {


    /**
     * [新增]
     * @param filterCondition
     * @return int 
     * @create 2021/2/22 18:02
     */
    int insert(FilterCondition filterCondition);

    /**
     * [刪除]
     * @param id
     * @return int
     * @create 2021/2/22 18:02
     */
    int deleteById(Long id);

    /**
     * [更新]
     * @param filterCondition 
     * @return int 
     * @create 2021/2/22 18:03
     */
    int update(FilterCondition filterCondition);

    /**
     *
     * @param id
     * @return FilterCondition
     * @create 2021/2/22 18:03
     */
    FilterCondition selectFilterConditionById(Long id);

    /**
     * @Description 查看已保存的线索条件组
     * @Param Long userId
     * @Return List<FilterCondition>
     * @Date 2021/2/26 11:22
     */
    List<FilterCondition> viewClueSavedFilterCondition(@Param("userId") Long userId);

    /**
     * @Description 查看已保存的需求条件组
     * @Param Long userId
     * @Return List<FilterCondition>
     * @Date 2021/2/26 11:22
     */
    List<FilterCondition> viewDemandSavedFilterCondition(@Param("userId") Long userId);

    /**
     * @Description 根据关键字搜索线索条件组
     * @Param Long userId, String keyName
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:07
     */
    List<FilterCondition> selectClueFilterConditionByKeyName(@Param("userId") Long userId, @Param("keyName") String keyName);

    /**
     * @Description 根据关键字搜索需求条件组
     * @Param Long userId, String keyName
     * @Return List<FilterCondition>
     * @Date 2021/2/26 14:07
     */
    List<FilterCondition> selectDemandFilterConditionByKeyName(@Param("userId") Long userId, @Param("keyName") String keyName);

    /**
     * @Description 根据条件组名字获得条件组
     * @Param Long userId, String conditionName
     * @Return FilterCondition
     * @Date 2021/2/26 14:44
     */
    FilterCondition selectFilterConditionByConditionName(@Param("userId") Long userId, @Param("conditionName") String conditionName);
}
